package dlwntk6545.swing;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

public class SwingMenuActionListener implements ActionListener{
	
	
	
	public static void main(String[] args) {
		
		
		
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		//이벤트를 발생시킨 대상 구분
		//System.out.println(e.getActionCommand());
		
		System.out.println(e.getSource());
		switch(e.getActionCommand()){
			
			case "new" : 
				JOptionPane.showMessageDialog(null, "new 메뉴가 클릭 되었슴돠"
						,"new 메뉴",JOptionPane.QUESTION_MESSAGE); break;
			case "close" : 
				JOptionPane.showMessageDialog(null, "close 메뉴가 클릭 되었슴돠",
						"close 메뉴",JOptionPane.WARNING_MESSAGE); break;
			case "exit" : 
				System.exit(0); break;
			
		}
		
	}

}
